<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Project_mdl extends CI_Model {

	const TABLE = 'project';

    public function select(){
        return $this->db->get(self::TABLE)->result_array();
    }

    public function get_one(){
        return $this->db->get(self::TABLE)->row_array();
    }

    //统计
    public function get_count(){
        return $this->db->count_all_results(self::TABLE);
    }

    //添加
    public function create($data){
        $data['login_time'] = $data['create_time'] = time();
        return $this->db->insert(self::TABLE,$data);
    }
    //修改
    public function update($data){
    	$data['online_time'] = time();
        return $this->db->update(self::TABLE,$data);
    }
    //删除
    public function delete(){
        $data = ['status' => 2];
        return $this->update($data);
    }

    
	

}

/* End of file project_mdl.php */
/* Location: ./application/models/project_mdl.php */